package com.friend.entity.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: friend->ResponseResult
 * @description: ResponseResult
 * @author: yangzhanghui
 * @create: 2019-09-04 12:55
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseResult {
    private Integer status;

    private String msg;

    private Object data;

    public static ResponseResult ok(String msg, Object data){
        return new ResponseResult(200, msg == null ? "成功" : msg, data);
    }

    public static ResponseResult no(String msg, Object data){
        return new ResponseResult(500, msg == null ?  "失败" : msg, data);
    }
}
